home *** CD-ROM | disk | FTP | other *** search
- class AirExplosion
- {
- var position;
- var bmpCanvas;
- var bmpExplosion;
- var scale;
- var screenPos;
- function AirExplosion(pos)
- {
- this.position = pos.clone();
- this.bmpCanvas = Game.bmpDead;
- this.bmpExplosion = flash.display.BitmapData.loadBitmap("explosion3");
- this.scale = 0;
- Sounds.playSound("explsion");
- }
- function step(Void)
- {
- this.scale += (0.75 - this.scale) * 0.15;
- if(this.scale > 0.7)
- {
- Game.getInstance().removeHostileShot(this);
- }
- }
- function draw(leftEdge)
- {
- var _loc5_ = this.position.x - leftEdge;
- var _loc7_ = this.position.y;
- this.screenPos = new flash.geom.Point(_loc5_,_loc7_);
- var _loc2_ = new flash.geom.Matrix();
- _loc2_.translate((- this.bmpExplosion.width) / 2,(- this.bmpExplosion.height) / 2);
- var _loc6_ = new flash.geom.Matrix();
- _loc6_.scale(this.scale,this.scale);
- _loc2_.concat(_loc6_);
- var _loc13_ = this.bmpExplosion.width * this.scale / 2;
- var _loc12_ = this.bmpExplosion.height * this.scale / 2;
- var _loc4_ = new flash.geom.Matrix();
- _loc4_.translate(_loc5_,Game.screenH - this.position.y);
- _loc2_.concat(_loc4_);
- var _loc3_ = (1 - this.scale / 0.7) * 255;
- var _loc9_ = new flash.geom.ColorTransform(0,0,0,1 - this.scale,_loc3_,_loc3_,_loc3_,_loc3_);
- var _loc8_ = "normal";
- var _loc10_ = null;
- var _loc11_ = true;
- this.bmpCanvas.draw(this.bmpExplosion,_loc2_,_loc9_,_loc8_,_loc10_,_loc11_);
- }
- }
-